$(function() {
    //	点击登录
    $('.def_login').on('click', function() {
        $height = $('.login_btn_list');
        if ($height.height() == 0) {
            $height.height('100px')
        } else {
            $height.height('0')
        }
    })

    // 选择按钮弹框
    $('#exampleModal').on('show.bs.modal', function(event) {
        var button = $(event.relatedTarget);
        var recipient = button.data('whatever');
        var modal = $(this);
        modal.find('.modal-body input').attr("placeholder", recipient);
        if (recipient == "请输入ETH钱包地址") {
            modal.find('.modal-body input').attr("data-type", 1);
        } else {
            modal.find('.modal-body input').attr("data-type", 0);
        }
    })
    console.log(url);
    var prevent_repetition = true;
    $(".bound_btn").on("click", function() {
        if (prevent_repetition) {
            prevent_repetition = false;
            var walletType = $("#recipient-name").attr("data-type");
            var address = $("#recipient-name").val();
            if (!address) {
                alert("请输入支付密码");
                prevent_repetition = true;
                return false;
            }
            var d = {};
            d.walletType = walletType;
            d.address = address;
            $.ajax({
                url: url + '/bigWinner/api/login/entry',

                type: "POST",
                cache: false,
                data: d,
                dataType: "json",
                async: true, // 使用同步操作
                timeout: 50000, //超时时间：50秒
                error: function(error) {
                    console.log(error);
                },
                success: function(data) {
                    //...
                }
            });
        }

        //  	$("#exampleModal").modal("hide");
        //  	$("#exampleModal1").modal("toggle");
    })
})